<?php 
if (!isset($_SESSION)) session_start();


/*
chdir ("{$_SERVER["DOCUMENT_ROOT"]}/modules/modules/dev_track/activities");


*/

$count=0;
chdir("../activities");
$d = dir(".");
while (false !== ($entry = $d->read())) {
	if (substr_count($entry,"_details.txt")>0) $count++;
}


$count++;

file_put_contents("{$count}_started.txt", date("Y/n/j G:i"));
file_put_contents("{$count}_details.txt", $_REQUEST["dev_track_details"]);
file_put_contents("{$count}_type.txt", $_REQUEST["dev_track_type"]);
file_put_contents("{$count}_owner.txt", $_SESSION["username"]);

//$count++;
echo "Request {$count} created";
mail("mb@dsq.co.uk", "Request {$count}" , "Request {$count}");

?>